﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace TicketMovie.Admin
{
    public partial class WebForm12 : System.Web.UI.Page
    {
        private DataClasses1DataContext dc = new DataClasses1DataContext();
        protected void Page_Load(object sender, EventArgs e)
        {
            this.RepeatertyperoomList.DataSource = this.dc.Type_rooms.ToList();
            this.RepeatertyperoomList.DataBind();
        }
        protected void LinkButtonXoa_Click(object sender, EventArgs e)
        {
            LinkButton lb = (LinkButton)sender;
            HiddenField hf = (HiddenField)lb.Parent.FindControl("HiddenFieldDelTyperoom");
            Type_room tpro = this.dc.Type_rooms.Single(tp => tp.type_room1 == Convert.ToString(hf.Value));
            this.dc.Type_rooms.DeleteOnSubmit(tpro);
            this.dc.SubmitChanges();
        }
    }
}